<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title>统一地图平台</title><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <style>
        html,
        body,
        #mapui {
            width: 100%;
            height: 100%;
        }

        html,
        body {
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <div id="mapui"></div>

    <script src="./js_example/script/map.min.js"></script>
    <script src="./js_example/script/demo.js"></script>
    <script src="./js_thematic_map_example/script/jq/jquery.min.js"></script>
    <script>
        var amap = null;
        var that = this;
        map.Factory.create('mapui', {
            center: [106.17609405517578, 35.41583177128595],
            fullExtent: {
                xmin: 90.992204,
                ymin: 10.979711,
                xmax: 120.5338915,
                ymax: 50.543712
            },
            zoom: 3,
            projection: 'EPSG:4326',
            strategy: ['mapboxgl', 'openlayers'],
            style: style
        }, (o) => {
            amap = o;
            map.Factory.loadSpecialMap('mapv' , () =>{
                that.init(amap);
            })
        });


        function init(map) {
            var data = [];

            $.get('./js_thematic_map_example/data/china-point.json', function (rs) {
                for (var i = 0; i < rs[0].length; i++) {
                    var geoCoord = rs[0][i].geoCoord;
                    data.push({
                        geometry: {
                            type: 'Point',
                            coordinates: geoCoord
                        },
                        time: Math.random() * 10
                    });
                }

                var dataSet = new special_mapv.DataSet(data);
                var options = {
                    fillStyle: 'rgba(220,20,60,0.6)',
                    //shadowColor: 'rgba(255, 250, 50, 0.5)',
                    //shadowBlur: 3,
                    updateCallback: function (time) {
                        time = time.toFixed(2);
                        $('#time').html('时间' + time);
                    },
                    size: 3,
                    draw: 'simple',
                    animation: {
                        type: 'time',
                        stepsRange: {
                            start: 0,
                            end: 10
                        },
                        trails: 1,
                        duration: 6,
                    }
                }
                var mapvLayer = new special_mapv.FmLayer(map, dataSet, options);

            });

        }
    </script>
</body>

</html>